"use strict";
function identity(arg) {
    return arg;
}
identity("你好");
identity(1);
/**
 * 传多个泛型
 * @param data1
 * @param data2
 */
function identity2(data1, data2) {
    Date.now() % 2 ? console.log(data1) : console.log(data2);
}
identity2('sss', 111);
identity2(111, true);
/**
 * 泛型返回值
 * @param data1
 * @param data2
 * @returns T | U
 */
function identity3(data1, data2) {
    return Date.now() % 2 ? data1 : data2;
}
console.log(identity3('sss', 111));
/**
 *
 * @param arg 泛型数组
 * @returns
 */
function loggingIdentity(arg) {
    console.log(arg.length);
    return arg;
}
loggingIdentity([1, 2]);
loggingIdentity([1, 2]);
let p0 = {
    name: 'jack',
    age: 12,
    extraInfo: 250
};
// T传type类型
let p10 = {
    name: 'jack',
    age: 12,
    extraInfo: {
        title: "",
        company: "cc"
    }
};
